package entities;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the resolutions database table.
 * 
 */
@Entity
@Table(name="resolutions")
public class Resolution implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private ResolutionPK id;

	//bi-directional many-to-many association to Camera
    @ManyToMany
	@JoinTable(
		name="suport_res"
		, joinColumns={
			@JoinColumn(name="width", referencedColumnName="width"),
			@JoinColumn(name="height", referencedColumnName="height")
			}
		, inverseJoinColumns={
			@JoinColumn(name="model")
			}
		)
	private List<Camera> cameras;

    public Resolution() {
    }

	public ResolutionPK getId() {
		return this.id;
	}

	public void setId(ResolutionPK id) {
		this.id = id;
	}
	
	public List<Camera> getCameras() {
		return this.cameras;
	}

	public void setCameras(List<Camera> cameras) {
		this.cameras = cameras;
	}
	
}